<?php

namespace app\api\validate;

use think\Validate;

class Role extends Validate
{

    /**
     * 验证规则
     */
    protected $rule = [
        'role_name|角色名称' => 'require|max:100|unique:role',
    ];

    /**
     * 场景
     */
    protected $scene = [
        'add'   =>  ['role_name'],
        'edit'  =>  ['role_name'=>'require|max:100'],
    ];    
}
